package cn.com.dycc.notice.service;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.text.ParseException;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.baidu.yun.push.exception.PushClientException;
import com.baidu.yun.push.exception.PushServerException;

import cn.com.dycc.notice.entity.Message;
import cn.com.dycc.notice.entity.MessageParam;
import cn.com.dycc.sys_manage.usersysmanagement.service.UserNotFoundException;



/**
 * 
 * Description: 系统公告Service层
 * Author: Liket
 * Version: 1.0
 * Create Date Time: 2017年8月4日 上午8:37:42.
 * Update Date Time: 
 * @see
 */
public interface MessageService {
	/**
	 * 添加公告
	 * @param message 公告实体参数
	 * @return 公告实体
	 */
	int addMessage(MessageParam message,HttpServletRequest req)throws UserNotFoundException,MessageNotFoundException,PushClientException, PushServerException, IOException;
	/**
	 * 阅读公告
	 * @param user_id 用户ID
	 * @param message_id 公告ID
	 * @param replay 回复
	 * @return 一个公告接收人实体
	 * @throws UserNotFoundException 找不到用户时抛出异常
	 * @throws MessageNotFoundException 阅读公告发生错误抛出异常
	 */
	//MessageReceivePerson readMessage(Integer user_id,Integer message_id,String replay)throws UserNotFoundException,MessageNotFoundException;
	/**
	 * 显示公告
	 * @param user_id 用户ID
	 * @return 返回所有公告集合
	 * @throws MessageNotFoundException 找不到公告时抛出异常
	 */
	List<Message> listMessage(HttpServletRequest req,Integer page,Integer limit,String title)throws MessageNotFoundException;
	
	int deleteMessage(Message message)throws MessageNotFoundException;
	
	int deleteMessageAll(String []message_ids,HttpServletRequest req)throws MessageNotFoundException;
	
	boolean updateMessage(MessageParam message,HttpServletRequest req)throws MessageNotFoundException,UnsupportedEncodingException;
	
	List<Message> listMessageByPage(Integer page,HttpServletRequest req)throws MessageNotFoundException,IOException;
	
	List<Message> findMessageById(String message_id,HttpServletRequest req)throws MessageNotFoundException;
	
	int countMessage(HttpServletRequest req)throws MessageNotFoundException;
	
	/**
	 * 多参数查询
	 * @param message 实体参数
	 * @return
	 * @throws MessageNotFoundException
	 */
	List<Message> listMessageByParam(HttpServletRequest erq,String send_date_start,String send_date_end,String title,String username)throws MessageNotFoundException,ParseException;
	
	/**
	 * 公告列表查询统计 20180510linfangan
	 * @param req
	 * @param title
	 * @return
	 * @throws MessageNotFoundException
	 */
	public String findMessAgeCount(HttpServletRequest req,String title)throws MessageNotFoundException;
}
